<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
	</body>
	<script>
		window.onload =function(){
			let str ="sacddxaddsadscxsaq"
			//1 4
			let target ="abc"
			let index  =0
			while (str.indexOf(target,index)!= -1){
				console.log(str.indexOf(target,index))
				index =str.indexOf(target,index)+1
			}
			while(str.indexOf(target)!=-1){
				str =str.replace(target,"###")
			}
			console.dir(str)		
		}
	</script>
</html>
